\(\int \frac {a+i a \tan (c+d x)}{\sqrt {e \cos (c+d x)}} \, dx\) [659]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [C] (verified)
   Fricas [C] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F(-2)]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 26, antiderivative size = 60 \[ \int \frac {a+i a \tan (c+d x)}{\sqrt {e \cos (c+d x)}} \, dx=\frac {2 i a}{d \sqrt {e \cos (c+d x)}}+\frac {2 a \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{d \sqrt {e \cos (c+d x)}} \]

[Out]

2*I*a/d/(e*cos(d*x+c))^(1/2)+2*a*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2*d*x+1/2*c)*EllipticF(sin(1/2*d*x+1/2*c),
2^(1/2))*cos(d*x+c)^(1/2)/d/(e*cos(d*x+c))^(1/2)

Rubi [A] (verified)

Time = 0.10 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3596, 3567, 3856, 2720} \[ \int \frac {a+i a \tan (c+d x)}{\sqrt {e \cos (c+d x)}} \, dx=\frac {2 a \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{d \sqrt {e \cos (c+d x)}}+\frac {2 i a}{d \sqrt {e \cos (c+d x)}} \]

[In]

Int[(a + I*a*Tan[c + d*x])/Sqrt[e*Cos[c + d*x]],x]

[Out]

((2*I)*a)/(d*Sqrt[e*Cos[c + d*x]]) + (2*a*Sqrt[Cos[c + d*x]]*EllipticF[(c + d*x)/2, 2])/(d*Sqrt[e*Cos[c + d*x]
])

Rule 2720

Int[1/Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticF[(1/2)*(c - Pi/2 + d*x), 2], x] /; FreeQ
[{c, d}, x]

Rule 3567

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*((d*Sec[
e + f*x])^m/(f*m)), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rule 3596

Int[(cos[(e_.) + (f_.)*(x_)]*(d_.))^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(d*Co
s[e + f*x])^m*(d*Sec[e + f*x])^m, Int[(a + b*Tan[e + f*x])^n/(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e,
f, m, n}, x] &&  !IntegerQ[m]

Rule 3856

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Dist[(b*Csc[c + d*x])^n*Sin[c + d*x]^n, Int[1/Sin[c + d
*x]^n, x], x] /; FreeQ[{b, c, d}, x] && EqQ[n^2, 1/4]

Rubi steps \begin{align*} \text {integral}& = \frac {\int \sqrt {e \sec (c+d x)} (a+i a \tan (c+d x)) \, dx}{\sqrt {e \cos (c+d x)} \sqrt {e \sec (c+d x)}} \\ & = \frac {2 i a}{d \sqrt {e \cos (c+d x)}}+\frac {a \int \sqrt {e \sec (c+d x)} \, dx}{\sqrt {e \cos (c+d x)} \sqrt {e \sec (c+d x)}} \\ & = \frac {2 i a}{d \sqrt {e \cos (c+d x)}}+\frac {\left (a \sqrt {\cos (c+d x)}\right ) \int \frac {1}{\sqrt {\cos (c+d x)}} \, dx}{\sqrt {e \cos (c+d x)}} \\ & = \frac {2 i a}{d \sqrt {e \cos (c+d x)}}+\frac {2 a \sqrt {\cos (c+d x)} \operatorname {EllipticF}\left (\frac {1}{2} (c+d x),2\right )}{d \sqrt {e \cos (c+d x)}} \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 4 in optimal.

Time = 2.24 (sec) , antiderivative size = 143, normalized size of antiderivative = 2.38 \[ \int \frac {a+i a \tan (c+d x)}{\sqrt {e \cos (c+d x)}} \, dx=-\frac {\sqrt {2} a \sqrt {e \cos (c+d x)} (-i+\cot (c)) \left (\sqrt {2} \sqrt {\csc ^2(c)}+i \cos (c+d x) \sqrt {1+\cos (2 d x-2 \arctan (\cot (c)))} \csc (c) \, _2F_1\left (\frac {1}{4},\frac {1}{2};\frac {5}{4};\sin ^2(d x-\arctan (\cot (c)))\right ) \sec (d x-\arctan (\cot (c)))\right ) \sin (c) (\cos (d x)-i \sin (d x)) (-i+\tan (c+d x))}{d e \sqrt {\csc ^2(c)}} \]

[In]

Integrate[(a + I*a*Tan[c + d*x])/Sqrt[e*Cos[c + d*x]],x]

[Out]

-((Sqrt[2]*a*Sqrt[e*Cos[c + d*x]]*(-I + Cot[c])*(Sqrt[2]*Sqrt[Csc[c]^2] + I*Cos[c + d*x]*Sqrt[1 + Cos[2*d*x -
2*ArcTan[Cot[c]]]]*Csc[c]*HypergeometricPFQ[{1/4, 1/2}, {5/4}, Sin[d*x - ArcTan[Cot[c]]]^2]*Sec[d*x - ArcTan[C
ot[c]]])*Sin[c]*(Cos[d*x] - I*Sin[d*x])*(-I + Tan[c + d*x]))/(d*e*Sqrt[Csc[c]^2]))

Maple [C] (verified)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 3.06 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.22

method result size
parts \(\frac {2 a \sqrt {2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \operatorname {am}^{-1}\left (\frac {d x}{2}+\frac {c}{2}| \sqrt {2}\right )}{d \sqrt {e \left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right )}}+\frac {2 i a}{d \sqrt {e \cos \left (d x +c \right )}}\) \(73\)
default \(-\frac {2 \left (\sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, F\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}-i \sin \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a}{\sqrt {-2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) e +e}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) d}\) \(93\)

[In]

int((a+I*a*tan(d*x+c))/(e*cos(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

2*a/d/(e*(2*cos(1/2*d*x+1/2*c)^2-1))^(1/2)*(2*cos(1/2*d*x+1/2*c)^2-1)^(1/2)*InverseJacobiAM(1/2*d*x+1/2*c,2^(1
/2))+2*I*a/d/(e*cos(d*x+c))^(1/2)

Fricas [C] (verification not implemented)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.08 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.48 \[ \int \frac {a+i a \tan (c+d x)}{\sqrt {e \cos (c+d x)}} \, dx=-\frac {2 \, {\left (-2 i \, \sqrt {\frac {1}{2}} \sqrt {e e^{\left (2 i \, d x + 2 i \, c\right )} + e} a e^{\left (\frac {1}{2} i \, d x + \frac {1}{2} i \, c\right )} + {\left (i \, \sqrt {2} a e^{\left (2 i \, d x + 2 i \, c\right )} + i \, \sqrt {2} a\right )} \sqrt {e} {\rm weierstrassPInverse}\left (-4, 0, e^{\left (i \, d x + i \, c\right )}\right )\right )}}{d e e^{\left (2 i \, d x + 2 i \, c\right )} + d e} \]

[In]

integrate((a+I*a*tan(d*x+c))/(e*cos(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

-2*(-2*I*sqrt(1/2)*sqrt(e*e^(2*I*d*x + 2*I*c) + e)*a*e^(1/2*I*d*x + 1/2*I*c) + (I*sqrt(2)*a*e^(2*I*d*x + 2*I*c
) + I*sqrt(2)*a)*sqrt(e)*weierstrassPInverse(-4, 0, e^(I*d*x + I*c)))/(d*e*e^(2*I*d*x + 2*I*c) + d*e)

Sympy [F]

\[ \int \frac {a+i a \tan (c+d x)}{\sqrt {e \cos (c+d x)}} \, dx=i a \left (\int \left (- \frac {i}{\sqrt {e \cos {\left (c + d x \right )}}}\right )\, dx + \int \frac {\tan {\left (c + d x \right )}}{\sqrt {e \cos {\left (c + d x \right )}}}\, dx\right ) \]

[In]

integrate((a+I*a*tan(d*x+c))/(e*cos(d*x+c))**(1/2),x)

[Out]

I*a*(Integral(-I/sqrt(e*cos(c + d*x)), x) + Integral(tan(c + d*x)/sqrt(e*cos(c + d*x)), x))

Maxima [F]

\[ \int \frac {a+i a \tan (c+d x)}{\sqrt {e \cos (c+d x)}} \, dx=\int { \frac {i \, a \tan \left (d x + c\right ) + a}{\sqrt {e \cos \left (d x + c\right )}} \,d x } \]

[In]

integrate((a+I*a*tan(d*x+c))/(e*cos(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

integrate((I*a*tan(d*x + c) + a)/sqrt(e*cos(d*x + c)), x)

Giac [F(-2)]

Exception generated. \[ \int \frac {a+i a \tan (c+d x)}{\sqrt {e \cos (c+d x)}} \, dx=\text {Exception raised: TypeError} \]

[In]

integrate((a+I*a*tan(d*x+c))/(e*cos(d*x+c))^(1/2),x, algorithm="giac")

[Out]

Exception raised: TypeError >> an error occurred running a Giac command:INPUT:sage2:=int(sage0,sageVARx):;OUTP
UT:Unable to divide, perhaps due to rounding error%%%{%%{[%%%{-4,[1]%%%},0]:[1,0,%%%{1,[1]%%%}]%%},[2,1]%%%}+%
%%{%%%{8,[2

Mupad [B] (verification not implemented)

Time = 0.66 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.23 \[ \int \frac {a+i a \tan (c+d x)}{\sqrt {e \cos (c+d x)}} \, dx=\frac {2\,a\,\sqrt {\cos \left (c+d\,x\right )}\,\mathrm {F}\left (\frac {c}{2}+\frac {d\,x}{2}\middle |2\right )}{d\,\sqrt {e\,\cos \left (c+d\,x\right )}}+\frac {a\,\cos \left (c+d\,x\right )\,\sqrt {e\,\cos \left (c+d\,x\right )}\,4{}\mathrm {i}}{d\,e\,\left (\cos \left (2\,c+2\,d\,x\right )+1\right )} \]

[In]

int((a + a*tan(c + d*x)*1i)/(e*cos(c + d*x))^(1/2),x)

[Out]

(2*a*cos(c + d*x)^(1/2)*ellipticF(c/2 + (d*x)/2, 2))/(d*(e*cos(c + d*x))^(1/2)) + (a*cos(c + d*x)*(e*cos(c + d
*x))^(1/2)*4i)/(d*e*(cos(2*c + 2*d*x) + 1))